package com.pearadmin.pro.modules.stu.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.stu.domain.StuGrade;
import com.pearadmin.pro.modules.stu.param.StuGradeRequest;
import com.pearadmin.pro.modules.stu.repository.StuGradeRepository;
import com.pearadmin.pro.modules.stu.service.StuGradeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
 * 学生成绩单Service业务层处理
 *
 * @author chenJian
 * @date 2021-09-09
 */
@Service
public class StuGradeServiceImpl extends ServiceImpl<StuGradeRepository, StuGrade> implements StuGradeService
{
    @Resource
    private StuGradeRepository stuGradeRepository;

    /**
     * 查询学生成绩单
     * @param request
     * @return 学生成绩单 分页集合
     * */
    @Override
    public PageResponse<StuGrade> page(StuGradeRequest request)
    {
        LambdaQueryWrapper<StuGrade> query = new LambdaQueryWrapper<StuGrade>();
        return Pageable.of(request,(()->  stuGradeRepository.selectList(query)));
    }

    /**
     * 查询学生成绩单
     *
     * @param id 学生成绩单ID
     * @return 学生成绩单
     */
    @Override
    public StuGrade selectStuGradeById(Long id)
    {
        return stuGradeRepository.selectById(id);
    }

}
